package com.alibaba.citrus.cr.sales.plan.api.salesplan;

import com.alibaba.citrus.cr.sales.plan.dto.api.request.BatchUpdateLineStatusRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.EditSalesPlanLineRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.SubmitSalesPlanLineRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.UpdateAdjustCountRequest;
import com.alibaba.citrus.cr.sales.plan.dto.api.request.UpdateTaskCountRequest;
import com.alibaba.citrus.cr.sales.plan.sdo.SalesPlanLineSDO;
import com.alibaba.lattice2.epoch.meshflow.model.annotation.MeshFlowService;
import com.alibaba.lattice2.epoch.sdk.model.Result;

import java.util.List;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-06 19:10
 */
@MeshFlowService(apps = {"bc_order"}, name = "SalesPlanLineWriteService")
public interface SalesPlanLineWriteService {

    /**
     * 添加明细， 早已废弃
     *
     * @param createSalesPlanRequest
     * @return
     */
    //Result<String> createSalesPlanLine(SalesPlanLineSDO createSalesPlanRequest);

    /**
     * 批量添加明细
     *
     * @param createPlanLineSdoList
     * @return
     */
    Result<String> batchCreateSalesPlanLine(List<SalesPlanLineSDO> createPlanLineSdoList);

    /**
     * 编辑明细  - 失去焦点保存
     *
     * @param editSalesPlanRequest
     * @return
     */
    Result<SalesPlanLineSDO> editSalesPlanLine(EditSalesPlanLineRequest editSalesPlanRequest);

    /**
     * 批量更新
     * 传参：planId,customerCode,customerAddress,scItemId
     * 可以是批量更新计划下的客户明细，也可以是批量更新计划下的货品明细
     * //校验对应维度下有没有草稿明细，有着阻断
     * 拉取待更新（状态2）的明细，更新为3（填写完成）
     * 上一部拉去的明细去汇总
     *
     * @param request： 筛选要被提交的计划明细数据（客户、货品）
     * @return
     */
    Result<Boolean> submitSalesPlanLine(SubmitSalesPlanLineRequest request);

    /**
     * 批量删除明细(状态变更-1)
     *
     * @param batchUpdateLineStatusRequest
     * @return
     */
    Result<Integer> batchUpdateLineStatus(BatchUpdateLineStatusRequest batchUpdateLineStatusRequest);

    /**
     * 修改计划明细任务量
     *
     * @param updateTaskCountRequest
     * @return
     */
    Result<Boolean> updateTaskCount(UpdateTaskCountRequest updateTaskCountRequest);

    /**
     * 修改计划明细调整
     * @param updateAdjustCountRequest
     * @return
     */
    Result<Integer> updateAdjustCount(UpdateAdjustCountRequest updateAdjustCountRequest);

    /**
     * 批量导入添加明细
     *
     * @param createPlanLineSdoList
     * @return
     */
    Result<String> batchImportCreateSalesPlanLine(List<SalesPlanLineSDO> createPlanLineSdoList);
}
